tg-me.com/python_codes/120
Create:
Last Update:
Last Update:
"""
The following code adds two positive integers without using the '+' operator.
The code uses bitwise operations to add two numbers.
Input: 2 3
Output: 5
"""def add_bitwise_operator(x, y):
Share and Support @python_codes
while y:
carry = x & y
x = x ^ y
y = carry << 1
return x
BY Python Codes
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Share with your friend now:
tg-me.com/python_codes/120